package com.zhou.JavaAndroidFirm.presenter;

import com.zhou.JavaAndroidFirm.bean.PhotoGirl;
import com.zhou.JavaAndroidFirm.constract.PhotosListContract;
import com.zhou.JavaAndroidFirm.rx.RxSubscriber;

import java.util.List;

/**
 * @author Administrator
 * @date 2018/7/18 0018
 * @des
 */
public class PhotosListPresenter extends PhotosListContract.Presenter {
    @Override
    public void getPhotosListData(int size, int page) {
        addSubscribe(mModel.getPhotosListData(size , page).subscribe(new RxSubscriber<List<PhotoGirl>>(mContext, false) {
            @Override
            protected void _onNext(List<PhotoGirl> photoGirls) {
                mView.returnPhotosListData(photoGirls);
            }

            @Override
            protected void _onError(String message) {
                mView.showTip(message);
            }
        }));
    }
}
